package com.company.Serializable;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

public class SerializableTest {
    /**
     * @title  序列化和反序列化 demo
     * @description
     * @author
     * @throws
     * @updateTime
     */
    public static void main(String[] args) throws Exception{
        //序列化
        FileOutputStream fos = new FileOutputStream("object");
        ObjectOutputStream oos = new ObjectOutputStream(fos);
        Student student1 = new Student("lihao", "123", "男");
        oos.writeObject(student1);
        oos.flush();
        oos.close();
        //反序列化


    }

}
